package com.gyl.web.action;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gyl.Container.ServiceProvider;
import com.gyl.domain.base.Department;
import com.gyl.query.PageResult;
import com.gyl.query.base.DepartmentQuery;
import com.gyl.service.DepartmentService;
import com.gyl.web.form.DepartmentForm;
import com.opensymphony.xwork2.ActionContext;

@Controller("departmentAction")
@Scope("prototype")
public class DepartmentAction extends BaseAction<DepartmentForm>{
	
	@Resource(name=DepartmentService.SERVICE_NAME)
	private DepartmentService departmentService ;
	
	private DepartmentQuery baseQuery = new DepartmentQuery() ;
	
	public String showPageResult() {
		PageResult<Department> departments = departmentService.findPageResult(baseQuery) ;
		ActionContext.getContext().put("departments", departments) ;
		return listAction ;
	}
	
}
